<template>
  <div class="Two">
    <div>Two</div>
    <!-- <p>count:{{ count }}</p> -->
    <p>count2:{{ count2 }}</p>
  </div>
</template>

<script>
export default {
  name: "Two",
  //inject配置项:用来注入祖辈的组件使用provide提供的数据,是一个数组格式
  inject: ["count"],
  // inject: ["obj", "count"],
  computed: {
    /* count() {
      return this.obj.count;
    }, */
    count2() {
      return this.count();
    },
  },
};
</script>

<style scoped>
.Two {
  border: 1px solid red;
}
</style>
